<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="任务编号" prop="taskCode">
        <el-input
          v-model="queryParams.taskCode"
          placeholder="请输入任务编号"
          clearable
          @keyup.enter="handleQuery"
        />
      </el-form-item>
      <el-form-item label="维修项目" prop="repairItem">
        <el-input
          v-model="queryParams.repairItem"
          placeholder="请输入维修项目"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="维修状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="请选择维修状态" clearable>
          <el-option label="待处理" value="待处理" />
          <el-option label="处理中" value="处理中" />
          <el-option label="已完成" value="已完成" />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" :icon="Search" @click="handleQuery">搜索</el-button>
        <el-button :icon="Refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          :icon="Plus"
          @click="handleAdd"
          v-hasPermi="['qep:repair-task:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          :icon="Edit"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['qep:repair-task:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          :icon="Delete"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['qep:repair-task:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          :icon="Download"
          @click="handleExport"
        >导出</el-button>
      </el-col>
      <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="repairTaskList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="序号" align="center" type="index" width="50"/>
      <el-table-column label="任务编号" align="center" prop="taskCode" />
      <el-table-column label="不合格品ID" align="center" prop="nonconformingId" />
      <el-table-column label="维修项目" align="center" prop="repairItem" />
      <el-table-column label="维修人员" align="center" prop="repairPerson" />
      <el-table-column label="维修部门" align="center" prop="repairDepartment" />
      <el-table-column label="实际开始时间" align="center" prop="actualStartTime" width="160">
        <template #default="scope">
          <span>{{ parseTime(scope.row.actualStartTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="实际结束时间" align="center" prop="actualEndTime" width="160">
        <template #default="scope">
          <span>{{ parseTime(scope.row.actualEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="维修状态" align="center" prop="statusText">
        <template #default="scope">
          <el-tag :type="scope.row.statusText === '已完成' ? 'success' : scope.row.statusText === '处理中' ? 'warning' : 'info'">
            {{ scope.row.statusText || '待处理' }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
          <el-button
            link
            type="primary"
            :icon="View"
            @click="handleView(scope.row)"
            v-hasPermi="['qep:repair-task:query']"
          >查看</el-button>
          <el-button
            link
            type="success"
            :icon="Star"
            @click="handleEvaluation(scope.row)"
          >评价</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      v-model:page="queryParams.pageNum"
      v-model:limit="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改维修任务对话框 -->
    <el-dialog :title="title" v-model="open" width="800px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="不合格品ID" prop="nonconformingId">
              <el-input v-model="form.nonconformingId" placeholder="请输入不合格品ID" :disabled="nonconformingFields.nonconformingId" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="产品信息" prop="productName" v-if="nonconformingFields.productId && form.productName">
              <el-input v-model="form.productName" placeholder="产品信息" disabled />
            </el-form-item>
            <el-form-item label="维修项目" prop="repairItem" v-else>
              <el-input v-model="form.repairItem" placeholder="请输入维修项目" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="nonconformingFields.batchId || nonconformingFields.defectId">
          <el-col :span="12" v-if="nonconformingFields.batchId && form.batchCode">
            <el-form-item label="批次信息" prop="batchCode">
              <el-input v-model="form.batchCode" placeholder="批次信息" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="nonconformingFields.defectId && form.defectName">
            <el-form-item label="缺陷名称" prop="defectName">
              <el-input v-model="form.defectName" placeholder="缺陷名称" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="nonconformingFields.defectDescription && form.defectDescription">
          <el-col :span="24">
            <el-form-item label="缺陷描述" prop="defectDescription">
              <el-input v-model="form.defectDescription" type="textarea" placeholder="缺陷描述" disabled />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="维修项目" prop="repairItem" v-if="nonconformingFields.productId && form.productName">
              <el-input v-model="form.repairItem" placeholder="请输入维修项目" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="维修人员" prop="repairPerson">
              <el-select 
                v-model="form.repairPerson" 
                placeholder="请选择维修人员" 
                style="width: 100%"
                filterable
                clearable>
                <el-option
                  v-for="item in repairPersonOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="维修部门" prop="repairDepartment">
              <el-select 
                v-model="form.repairDepartment" 
                placeholder="请选择维修部门" 
                style="width: 100%"
                filterable
                clearable>
                <el-option
                  v-for="item in repairDeptOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="计划开始时间" prop="planStartTime">
              <el-date-picker clearable
                v-model="form.planStartTime"
                type="datetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                placeholder="选择计划开始时间"
                :disabledDate="disabledDate"
                :disabled-hours="disabledHours"
                :disabled-minutes="disabledMinutes"
                :disabled-seconds="disabledSeconds">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="计划结束时间" prop="planEndTime">
              <el-date-picker clearable
                v-model="form.planEndTime"
                type="datetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                placeholder="选择计划结束时间"
                :disabledDate="disabledDate"
                :disabled-hours="disabledHours"
                :disabled-minutes="disabledMinutes"
                :disabled-seconds="disabledSeconds">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="实际开始时间" prop="actualStartTime">
              <el-date-picker clearable
                v-model="form.actualStartTime"
                type="datetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                placeholder="选择实际开始时间"
                :disabledDate="disabledDate"
                :disabled-hours="disabledHours"
                :disabled-minutes="disabledMinutes"
                :disabled-seconds="disabledSeconds">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="实际结束时间" prop="actualEndTime">
              <el-date-picker clearable
                v-model="form.actualEndTime"
                type="datetime"
                value-format="yyyy-MM-dd HH:mm:ss"
                placeholder="选择实际结束时间"
                :disabledDate="disabledDate"
                :disabled-hours="disabledHours"
                :disabled-minutes="disabledMinutes"
                :disabled-seconds="disabledSeconds">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="维修要求" prop="repairRequirements">
          <el-input v-model="form.repairRequirements" type="textarea" placeholder="请输入维修要求" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script>
import { listRepairTask, getRepairTask, addRepairTask, updateRepairTask, delRepairTask, getRepairTaskByNonconformingId } from "@/api/qep/repairTask";
import { getNonconforming } from "@/api/qep/nonconforming";
import { listDept } from "@/api/system/dept";
import { listUser } from "@/api/system/user";
import { Search, Refresh, Plus, Edit, Delete, Download, View, Star } from '@element-plus/icons-vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import { repairTaskCodeToStatus, repairTaskStatusToCode, calculateRepairStatus } from "@/utils/statusConverter";
import { getToken } from "@/utils/auth";
import request from "@/utils/request";

export default {
  name: "RepairTask",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出加载
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 维修任务表格数据
      repairTaskList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 图标
      Search,
      Refresh,
      Plus,
      Edit,
      Delete,
      Download,
      View,
      Star,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        taskCode: null,
        repairItem: null,
        status: null,
        nonconformingId: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        nonconformingId: [
          { required: true, message: "不合格品ID不能为空", trigger: "blur" }
        ],
        repairItem: [
          { required: true, message: "维修项目不能为空", trigger: "blur" }
        ],
        repairPerson: [
          { required: true, message: "维修人员不能为空", trigger: "blur" }
        ],
        repairDepartment: [
          { required: true, message: "维修部门不能为空", trigger: "blur" }
        ],
        planStartTime: [
          { required: true, message: "计划开始时间不能为空", trigger: "blur" }
        ],
        planEndTime: [
          { required: true, message: "计划结束时间不能为空", trigger: "blur" }
        ]
      },
      readOnly: false,
      // 不合格品记录相关字段，从不合格品记录带过来的字段标记为不可编辑
      nonconformingFields: {
        nonconformingId: false,
        productId: false,
        productName: false,
        batchId: false,
        batchCode: false,
        defectId: false,
        defectName: false,
        defectDescription: false
      },
      // 维修人员选项
      repairPersonOptions: [],
      // 维修部门选项
      repairDeptOptions: [],
    };
  },
  created() {
    // 从路由中获取不合格品ID，如果存在则创建相应的维修任务
    const nonconformingId = this.$route.query.nonconformingId;
    if (nonconformingId) {
      this.handleAddWithNonconforming(nonconformingId);
    } else {
      this.getList();
    }
    // 获取维修人员和部门选项
    this.getRepairPersonOptions();
    this.getRepairDeptOptions();
  },
  methods: {
    /** 查询维修任务列表 */
    getList() {
      this.loading = true;
      listRepairTask(this.queryParams).then(response => {
        this.repairTaskList = response.rows;
        
        // 日期格式化和状态计算已经在API中处理完成
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
      
      // 重置只读状态
      this.readOnly = false;
      
      // 确保对话框底部按钮显示
      this.$nextTick(() => {
        if (document.querySelector('.dialog-footer')) {
          document.querySelector('.dialog-footer').style.display = 'block';
        }
      });
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        taskCode: null,
        nonconformingId: this.queryParams.nonconformingId || null,
        repairItem: null,
        repairPerson: null,
        repairDepartment: null,
        repairRequirements: null,
        planStartTime: null,
        planEndTime: null,
        actualStartTime: null,
        actualEndTime: null,
        status: '待处理',
        remark: null,
        // 重置不合格品相关信息
        productId: null,
        productName: null,
        batchId: null,
        batchCode: null,
        defectId: null,
        defectName: null,
        defectDescription: null
      };
      
      // 重置不合格品字段状态
      Object.keys(this.nonconformingFields).forEach(key => {
        this.nonconformingFields[key] = false;
      });
      
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加维修任务";
    },
    /** 修改按钮操作 */
    handleUpdate() {
      this.reset();
      const id = this.ids[0];
      getRepairTask(id).then(response => {
        this.form = response.data;
        // 确保使用状态文本而不是状态码
        if (this.form.status && typeof this.form.status === 'number') {
          this.form.status = repairTaskCodeToStatus(this.form.status);
        }
        this.open = true;
        this.title = "修改维修任务";
      });
    },
    /** 获取维修人员选项 */
    getRepairPersonOptions() {
      listUser({}).then(response => {
        // 过滤只显示检修员角色的用户
        this.repairPersonOptions = response.rows
          .filter(item => {
            // 检查角色包含"检修员"或"维修员"或"维修人员"
            const hasRepairRole = item.roles && item.roles.some(role => 
              role.roleName && (
                role.roleName.includes('检修员') || 
                role.roleName.includes('维修员') || 
                role.roleName.includes('维修人员')
              )
            );
            // 如果没有角色信息，根据部门判断
            const hasRepairDept = item.dept && item.dept.deptName && (
              item.dept.deptName.includes('维修') || 
              item.dept.deptName.includes('检修') || 
              item.dept.deptName.includes('维护') ||
              item.dept.deptName.includes('技术') ||
              item.dept.deptName.includes('工程')
            );
            
            return hasRepairRole || hasRepairDept;
          })
          .map(item => {
            // 优先使用昵称，如果没有则使用用户名
            return {
              value: item.nickName || item.userName,
              label: item.nickName || item.userName
            };
          });
        
        // 如果没有符合条件的用户，添加默认维修人员
        if (this.repairPersonOptions.length === 0) {
          this.addDefaultRepairPersons();
        }
      }).catch(error => {
        console.error("获取维修人员选项失败:", error);
        this.addDefaultRepairPersons();
      });
    },
    
    /** 添加默认维修人员选项 */
    addDefaultRepairPersons() {
      this.repairPersonOptions = [
        { value: '王轩', label: '王轩' },
        { value: '李明', label: '李明' },
        { value: '张伟', label: '张伟' },
        { value: '赵强', label: '赵强' }
      ];
    },
    
    /** 获取维修部门选项 */
    getRepairDeptOptions() {
      listDept({}).then(response => {
        this.repairDeptOptions = response.data.map(item => {
          return {
            value: item.deptName,
            label: item.deptName
          };
        });
      }).catch(error => {
        console.error("获取维修部门选项失败:", error);
        // 添加默认维修部门选项，以防API不可用
        this.repairDeptOptions = [
          { value: '焊接部', label: '焊接部' },
          { value: '质检部', label: '质检部' },
          { value: '装配部', label: '装配部' },
          { value: '电气部', label: '电气部' }
        ];
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          // 因为表单中禁用的字段不会被提交，需要特殊处理
          const formData = { ...this.form };
          
          // 修正日期格式
          if (formData.planStartTime && !formData.planStartTime.includes('-')) {
            formData.planStartTime = new Date(formData.planStartTime).toISOString().replace('T', ' ').substring(0, 19);
          }
          if (formData.planEndTime && !formData.planEndTime.includes('-')) {
            formData.planEndTime = new Date(formData.planEndTime).toISOString().replace('T', ' ').substring(0, 19);
          }
          if (formData.actualStartTime && !formData.actualStartTime.includes('-')) {
            formData.actualStartTime = new Date(formData.actualStartTime).toISOString().replace('T', ' ').substring(0, 19);
          }
          if (formData.actualEndTime && !formData.actualEndTime.includes('-')) {
            formData.actualEndTime = new Date(formData.actualEndTime).toISOString().replace('T', ' ').substring(0, 19);
          }
          
          if (this.form.id != null) {
            updateRepairTask(formData).then(response => {
              ElMessage.success("修改成功");
              this.open = false;
              this.getList();
            }).catch(error => {
              console.error("更新维修任务失败:", error);
              ElMessage.error("更新失败，请检查数据格式");
            });
          } else {
            addRepairTask(formData).then(response => {
              ElMessage.success("新增成功");
              this.open = false;
              this.getList();
            }).catch(error => {
              console.error("添加维修任务失败:", error);
              ElMessage.error("添加失败，请检查数据格式");
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete() {
      const ids = this.ids;
      ElMessageBox.confirm('是否确认删除维修任务编号为"' + ids + '"的数据项?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        // 直接使用级联删除接口，简化前端逻辑
        return request({
          url: '/qep/repair-task/delete-cascade',
          method: 'delete',
          params: { ids: ids.join(',') }
        });
      }).then(() => {
        this.getList();
        ElMessage.success("删除成功");
      }).catch((error) => {
        // 处理删除失败的情况
        if (error === 'cancel') {
          return;
        }
        if (error.response && error.response.data && error.response.data.msg) {
          ElMessage.error("删除失败：" + error.response.data.msg);
        } else if (typeof error === 'string') {
          ElMessage.error("删除失败：" + error);
        } else {
          ElMessage.error("删除失败，可能存在关联的评价记录");
        }
        console.error("删除任务失败:", error);
      });
    },
    /** 查看详情按钮操作 */
    handleView(row) {
      this.reset();
      const id = row.id;
      getRepairTask(id).then(response => {
        // 确保数据完整性，包括时间格式
        this.form = {
          ...response.data,
          // 保留完整时间格式
          planStartTime: response.data.planStartTime,
          planEndTime: response.data.planEndTime,
          actualStartTime: response.data.actualStartTime,
          actualEndTime: response.data.actualEndTime
        };
        
        this.open = true;
        this.title = "查看维修任务";
        this.readOnly = true;  // 设置为只读模式
        
        // 禁用所有表单元素
        this.$nextTick(() => {
          // 获取所有输入框、选择器等表单元素并禁用
          const formElements = this.$refs.form.$el.querySelectorAll('input, select, textarea');
          formElements.forEach(element => {
            element.setAttribute('disabled', 'disabled');
          });
          
          // 隐藏底部按钮
          const dialogFooter = document.querySelector('.dialog-footer');
          if (dialogFooter) {
            dialogFooter.style.display = 'none';
          }
        });
      });
    },
    /** 跳转到评价页面 */
    handleEvaluation(row) {
      const taskId = row.id;
      
      // 获取最新的任务状态
      getRepairTask(taskId).then(response => {
        const task = response.data;
        // 计算实际状态
        const calculatedStatus = calculateRepairStatus(task.actualStartTime, task.actualEndTime);
        
        // 检查是否已完成
        if (calculatedStatus.text !== '已完成') {
          ElMessage({
            type: 'warning',
            message: '只能对已完成的维修任务进行评价'
          });
          return;
        }
        
        // 确认跳转
        ElMessageBox.confirm('是否为该维修任务添加评价?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'info'
        }).then(() => {
          // 跳转到评价页面，确保传递的是taskId参数
          this.$router.push({
            path: '/nonconforming/repair-evaluation',
            query: { taskId: taskId }
          });
        }).catch(() => {
          // 取消操作时不需要处理
        });
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      ElMessageBox.confirm('是否确认导出所有维修任务数据?', '提示', {
        confirmButtonText: '确认',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.exportLoading = true;
        
        // 设置请求超时
        const exportTimeout = setTimeout(() => {
          this.exportLoading = false;
          ElMessage.error('导出请求超时，请联系管理员');
        }, 30000); // 30秒超时
        
        // 使用内置的download方法
        this.download(
          '/qep/repair-task/export',
          { ...this.queryParams },
          `维修任务数据_${new Date().getTime()}.xlsx`,
          { responseType: 'blob' } // 确保responseType为blob
        ).then(() => {
          clearTimeout(exportTimeout);
          this.exportLoading = false;
          ElMessage.success('导出成功');
        }).catch((error) => {
          clearTimeout(exportTimeout);
          this.exportLoading = false;
          console.error('导出错误:', error);
          ElMessage.error('导出失败，请联系管理员');
        });
      }).catch(() => {
        // 用户取消操作
      });
    },
    /** 处理从不合格品页面传递过来的创建维修任务请求 */
    handleAddWithNonconforming(nonconformingId) {
      this.reset();
      
      // 首先获取不合格品详细信息
      getNonconforming(nonconformingId).then(response => {
        const nonconforming = response.data;
        
        // 填充不合格品相关信息
        this.form = {
          ...this.form,
          nonconformingId: nonconforming.id,
          productId: nonconforming.productId,
          productName: nonconforming.productName,
          batchId: nonconforming.batchId,
          batchCode: nonconforming.batchCode,
          defectId: nonconforming.defectId,
          defectName: nonconforming.defectName,
          defectDescription: nonconforming.defectDescription
        };
        
        // 标记这些字段为不可编辑
        Object.keys(this.nonconformingFields).forEach(key => {
          this.nonconformingFields[key] = true;
        });
        
        this.open = true;
        this.title = "创建维修任务";
        
        // 待表单渲染完成后禁用不合格品相关字段
        this.$nextTick(() => {
          if (this.$refs.form) {
            // 禁用不合格品ID字段
            const nonconformingFields = this.$refs.form.$el.querySelectorAll('[name="nonconformingId"], [name="productId"], [name="batchId"], [name="defectId"]');
            nonconformingFields.forEach(field => {
              field.setAttribute('disabled', 'disabled');
            });
          }
        });
      }).catch(() => {
        // 如果获取失败，仅使用ID，其他保持默认
        this.form.nonconformingId = nonconformingId;
        this.open = true;
        this.title = "创建维修任务";
      });
    },
    disabledDate(date) {
      // 不禁用任何日期
      return false;
    },
    disabledHours() {
      // 不禁用任何小时
      return [];
    },
    disabledMinutes() {
      // 不禁用任何分钟
      return [];
    },
    disabledSeconds() {
      // 不禁用任何秒
      return [];
    },
  }
};
</script> 